package pub.cleangao.memm.loadbalance;

import pub.cleangao.memm.transport.message.RpcRequest;

import java.util.List;
import java.util.Random;

public class RandomLoadBalancer extends AbstractLoadBalance {

    Random random = new Random();

    @Override
    protected String doSelect(List<String> serviceUrlList, RpcRequest rpcRequest) {
        return serviceUrlList.get(random.nextInt(serviceUrlList.size()));
    }
}
